//  config_manager.h
//  Progetto Ingegneria del Web
//
//  Created by Andrea Vitale on 15/10/12.
//  Copyright (c) 2012 Andrea Vitale. All rights reserved.

#ifndef Progetto_Ingegneria_del_Web_config_manager_h
#define Progetto_Ingegneria_del_Web_config_manager_h

//Data
typedef struct config_manager_t
{
    char* document_root;
    char* error_pages_path;
    char* log_level;
    char* log_error_path;
    char* log_error_filename;
    char* log_verbose_path;
    char* log_verbose_filename;
    
    float log_max_size;

    int buffer_size;
    int backlog_size;
    int port_number;
} config_manager_t;

config_manager_t* config_manager;

//Functions
config_manager_t* loadConfigFile(char* path);

char* trimWhiteSpace(char *str);

int isAValidConfig(config_manager_t config_manager);

void parseProperty(config_manager_t *config_manager, char* buffer, int buffer_size);
void printConfigProperties();

#endif
